﻿<div class="modal-header">
    <h3 class="modal-title">选择角色</h3>
</div>
<div class="modal-body">
    <form class="form-horizontal clearfix">
        <div class="col-lg-6 clear-padding">
            <div ce-enter="search" class="input-group">
                <input type="text" class="form-control" ng-model="Name" placeholder="搜索关键词：角色名称、系统权限名称">
                <span class="input-group-btn">
                    <button class="btn btn-default" ng-click="search(false)" type="button">搜索</button>
                </span>
            </div>
        </div>
    </form>
    <table class="table table-hover table-bordered">
        <thead>
            <tr>
                <th class="col-sm-1">选择</th>
                <th class="col-sm-2">角色</th>
                <th>权限</th>
                <th class="col-sm-1">操作</th>
            </tr>
        </thead>
        <tbody>
            <tr class="pointer" ng-click="checked(item)" ng-repeat="item in roles">
                <td><input type="checkbox" ng-checked="item.isChecked" /></td>
                <td>{{item.Name}}</td>
                <td>{{item.Powers|merge:'Name':7:'...'|none:'未关联角色'}}</td>
                <td><button class="btn btn-danger btn-xs">选择</button></td>
            </tr>
        </tbody>
        <tfoot>
            <tr>
                <td colspan="4">
                    <div class="pull-right">
                        <div class="pagination-info"><span class="ng-binding">共有{{total}}条</span>， <span class="ng-binding">每页显示：{{size}}条</span></div>
                        <uib-pagination boundary-links="true" total-items="total" ng-model="current" max-size="10" ng-change="search(true)"
                                        items-per-page="size" class="pagination-sm" previous-text="&lsaquo;"
                                        next-text="&rsaquo;" first-text="&laquo;"
                                        last-text="&raquo;"></uib-pagination>
                    </div>
                </td>
            </tr>
        </tfoot>
    </table>
</div>
<div class="modal-footer">
    <button class="btn btn-primary" ng-click="ok()">确定</button>
    <button class="btn btn-warning" ng-click="cancel()">取消</button>
</div>